import javax.swing.*;
import java.awt.*;

public class MenuTester {
  public static void main (String args[]) {
    
	RootMultistrokeMarkingMenu MSMM = new RootMultistrokeMarkingMenu();
	  
	MSMM.getRootMenu().addMenuItem("title1");
    
	MSMM.getRootMenu().addMenuItem("title2");
	MSMM.getRootMenu().setMenuItemLink("title2", "www.wired.com");
    
	MSMM.getRootMenu().addMenuItem("title3");
	MSMM.getRootMenu().setMenuItemLink("title3", "www.mmto.com");
	
	
	
	MSMM.access("root").addMenuItem("title4");
	
	MSMM.getRootMenu().setMenuItemLink("title4", "www.tacobell.com");
	MSMM.getRootMenu().removeMenuItem("title2");
    
	//MSMM.getRootMenu().setMenuItemDistance(75);
    
    
    MultistrokeMarkingMenu subPieMenu = new MultistrokeMarkingMenu(MSMM.getRootMenu());
    subPieMenu.addMenuItem("subtitle1");
    subPieMenu.setMenuItemLink("subtitle1", "www.yahoo.com");
    MSMM.getRootMenu().setMenuItemSubMenu("title3", subPieMenu);
    
    
    //System.out.println(MSMM);
    
    //MultistrokeMarkingMenu subSubPieMenu = new MultistrokeMarkingMenu(MSMM.access("root, title3, subtitle1"));
    //subSubPieMenu.addMenuItem("subtitle1");//!!!!
    //subSubPieMenu.setMenuItemLink("subtitle1", "www.yahoo.com");//!!!!!
   
    MSMM.access("root, title3, subtitle1").addMenuItemWithEmptySubMenu("Superman");
    MSMM.access("root, title3, subtitle1, Superman").addMenuItem("wow");
    MSMM.access("root, title3, subtitle1, Superman").setMenuItemLink("wow", "www.yahoo.com");
    
    MSMM.access("root, title3, subtitle1").addMenuItemWithEmptySubMenu("IronMan");
    MSMM.access("root, title3, subtitle1, IronMan").addMenuItem("nice");
    MSMM.access("root, title3, subtitle1, IronMan").setMenuItemLink("nice", "www.tacobell.com");
    //MSMM.access("root, title3").setMenuItemSubMenu("subtitle1", subSubPieMenu);
    
    MSMM.access("root, title3, subtitle1").addMenuItemWithEmptySubMenu("BatMan");
    MSMM.access("root, title3, subtitle1, BatMan").addMenuItem("cool");
    MSMM.access("root, title3, subtitle1, BatMan").setMenuItemLink("cool", "www.google.com");
    
    
    MSMM.access("root, title3, subtitle1").addMenuItemWithEmptySubMenu("CoolMan");
    MSMM.access("root, title3, subtitle1, CoolMan").addMenuItem("cool");
    MSMM.access("root, title3, subtitle1, CoolMan").setMenuItemLink("cool", "www.google.com");
    
    
    MSMM.access("root, title3, subtitle1").addMenuItemWithEmptySubMenu("UberMan");
    MSMM.access("root, title3, subtitle1, UberMan").addMenuItem("cool");
    MSMM.access("root, title3, subtitle1, UberMan").setMenuItemLink("cool", "www.google.com");
    
    MSMM.access("root, title3, subtitle1").addMenuItemWithEmptySubMenu("NiceMan");
    MSMM.access("root, title3, subtitle1, NiceMan").addMenuItem("cool");
    MSMM.access("root, title3, subtitle1, NiceMan").setMenuItemLink("cool", "www.google.com");
    
    MSMM.access("root, title3, subtitle1").addMenuItemWithEmptySubMenu("YahooMan");
    MSMM.access("root, title3, subtitle1, YahooMan").addMenuItem("super");
    MSMM.access("root, title3, subtitle1, YahooMan").setMenuItemLink("super", "www.google.com");
    
    MSMM.access("root, title3, subtitle1").addMenuItemWithEmptySubMenu("TacoMan");
    MSMM.access("root, title3, subtitle1, TacoMan").addMenuItem("nice");
    MSMM.access("root, title3, subtitle1, TacoMan").setMenuItemLink("nice", "www.google.com");
    
    //MSMM.access("root, title3").setMenuItemSubMenu("subtitle1", subSubPieMenu);
    JFrame frame = new JFrame("Test Menu");
    frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE); 
    
    
    
    //MSMM.addRootMenuTo(frame.getContentPane());
    frame.getContentPane().add(MSMM);
       
    frame.getComponent(0).setLocation(444, 333);
    int width = 1280;
    int height = 800;
    frame.setSize(width, height);
    //frame.pack();
    frame.setVisible(true);
    
    
    
    System.out.println(MSMM);
    MSMM.saveToFile();
    
    MSMM.popUpMenu("root, title3, subtitle1");
    
    //System.out.print(MSMM.parseXmlFile("RootMenu.xml", false).toString());
    
  }
}